package com.noah;

import com.noah.controller.StudentController;

import java.util.Scanner;
/**
 * @author linchaoran
 */
public class Application {
    public static void main(String[] args) {
        StudentController studentController = new StudentController();
        Scanner sc = new Scanner(System.in);

        boolean flag = true;

        while (flag) {
            System.out.println("1-新增学生");
            System.out.println("2-查看所有的学生");
            System.out.println("3-删除学生");
            System.out.println("4-修改学生信息");

            System.out.println("0-退出");
            System.out.println("请输入你的选择");
            String choice = sc.next();

            switch (choice) {
                case "1":
                    studentController.add();
                    break;
                case "2":
                    studentController.findAll();
                    break;
                case "3":
                    System.out.println("请输入要删除的学生学号");
                    String id = sc.next();
                    studentController.del(id);
                    break;
                case "4":
                    System.out.println("请输入要修改的学生学号");
                    String sid = sc.next();
                    studentController.update(sid);
                    break;
                case "0":
                    System.out.println("谢谢使用");
                    flag = false;
                    break;
                default:
                    System.out.println("输入有误");
                    break;
            }
        }
    }
}
